package xin.yangshuai.activemqproducer.config;

import org.apache.activemq.command.ActiveMQQueue;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jms.annotation.EnableJms;

import javax.jms.Queue;

/**
 * ConfigBean
 *
 * @author shuai
 * @date 2020/6/24
 */
@Configuration
@EnableJms  //声明对 JMS 注解的支持
public class ConfigBean {

    @Value("${myqueue}")
    public String myQueue;

    @Bean
    public Queue queue() {
        return new ActiveMQQueue(myQueue);
    }

}
